LanguageExt.Core

LanguageExt.Core Effects Eff Eff with runtime Prelude

Contents

class Prelude Source #

Methods

method Eff<RT, B> apply <RT, A, B> ( K<Eff<RT>, Func<A, B>> mf, K<Eff<RT>, A> ma) Source #

Applicative apply: takes the lifted function and the lifted argument, applies the function to the argument and returns the result, lifted.

method Eff<RT, C> apply <RT, A, B, C> ( K<Eff<RT>, Func<A, B, C>> mf, K<Eff<RT>, A> ma, K<Eff<RT>, B> mb) Source #

Applicative apply: takes the lifted function and the lifted argument, applies the function to the argument and returns the result, lifted.

method Eff<RT, Func<B, C>> apply <RT, A, B, C> ( K<Eff<RT>, Func<A, B, C>> mf, K<Eff<RT>, A> ma) Source #

Applicative apply: takes the lifted function and the lifted argument, applies the function to the argument and returns the result, lifted.

method Eff<RT, D> apply <RT, A, B, C, D> ( K<Eff<RT>, Func<A, B, C, D>> mf, K<Eff<RT>, A> ma, K<Eff<RT>, B> mb, K<Eff<RT>, C> mc) Source #

Applicative apply: takes the lifted function and the lifted argument, applies the function to the argument and returns the result, lifted.

method Eff<RT, Func<C, D>> apply <RT, A, B, C, D> ( K<Eff<RT>, Func<A, B, C, D>> mf, K<Eff<RT>, A> ma, K<Eff<RT>, B> mb) Source #

Applicative apply: takes the lifted function and the lifted argument, applies the function to the argument and returns the result, lifted.

method Eff<RT, Func<B, Func<C, D>>> apply <RT, A, B, C, D> ( K<Eff<RT>, Func<A, B, C, D>> mf, K<Eff<RT>, A> ma) Source #

Applicative apply: takes the lifted function and the lifted argument, applies the function to the argument and returns the result, lifted.

method Eff<RT, E> apply <RT, A, B, C, D, E> ( K<Eff<RT>, Func<A, B, C, D, E>> mf, K<Eff<RT>, A> ma, K<Eff<RT>, B> mb, K<Eff<RT>, C> mc, K<Eff<RT>, D> md) Source #

Applicative apply: takes the lifted function and the lifted argument, applies the function to the argument and returns the result, lifted.

method Eff<RT, Func<D, E>> apply <RT, A, B, C, D, E> ( K<Eff<RT>, Func<A, B, C, D, E>> mf, K<Eff<RT>, A> ma, K<Eff<RT>, B> mb, K<Eff<RT>, C> mc) Source #

Applicative apply: takes the lifted function and the lifted argument, applies the function to the argument and returns the result, lifted.

method Eff<RT, Func<C, Func<D, E>>> apply <RT, A, B, C, D, E> ( K<Eff<RT>, Func<A, B, C, D, E>> mf, K<Eff<RT>, A> ma, K<Eff<RT>, B> mb) Source #

Applicative apply: takes the lifted function and the lifted argument, applies the function to the argument and returns the result, lifted.

method Eff<RT, Func<B, Func<C, Func<D, E>>>> apply <RT, A, B, C, D, E> ( K<Eff<RT>, Func<A, B, C, D, E>> mf, K<Eff<RT>, A> ma) Source #

Applicative apply: takes the lifted function and the lifted argument, applies the function to the argument and returns the result, lifted.

class Prelude Source #

Methods

method Eff<RT, A> SuccessEff <RT, A> (A value) Source #

Construct an successful effect with a pure value

Parameters

type A

Bound value type

param value

Pure value to construct the monad with

returns

Synchronous IO monad that captures the pure value

method Eff<RT, A> FailEff <RT, A> (Error error) Source #

Construct a failed effect

Parameters

type A

Bound value type

param error

Error that represents the failure

returns

Synchronous IO monad that captures the failure

method Eff<RT, RT> runtime <RT> () Source #

Make the runtime into the bound value

method Eff<RT, (RT Runtime, EnvIO EnvIO)> getState <RT> () Source #

Get all of the internal state of the Eff

method Eff<RT, A> localCancel <RT, A> (Eff<RT, A> ma) Source #

Create a new cancellation context and run the provided Aff in that context

Parameters

type RT

Runtime environment

type A

Bound value type

param ma

Operation to run in the next context

returns

An asynchronous effect that captures the operation running in context

method Eff<OuterRT, A> localEff <OuterRT, InnerRT, A> (Func<OuterRT, InnerRT> f, Eff<InnerRT, A> ma) Source #

Create a new local context for the environment by mapping the outer environment and then Create a new local context for the environment by mapping the outer environment and then using the result as a new context when running the IO monad provided

Parameters

param f

Function to map the outer environment into a new one to run ma

param ma

IO monad to run in the new context

method Eff<RT, A> flatten <RT, A> (Eff<RT, Eff<RT, A>> mma) Source #

Monadic join operator

Collapses a nested IO monad so there is no nesting.

Parameters

type RT

Runtime

type E

Error type

type A

Bound value

param mma

Nest IO monad to flatten

returns

Flattened IO monad

method Eff<RT, A> liftEff <RT, A> (Func<RT, Either<Error, A>> f) Source #

Lift an effect into the Eff monad

method Eff<RT, A> liftEff <RT, A> (Func<RT, Fin<A>> f) Source #

Lift an effect into the Eff monad

method Eff<RT, A> liftEff <RT, A> (Func<RT, A> f) Source #

Lift an effect into the Eff monad

method Eff<RT, A> liftEff <RT, A> (Func<RT, Task<A>> f) Source #

Lift an effect into the Eff monad

method Eff<RT, A> liftEff <RT, A> (Func<RT, Task<Fin<A>>> f) Source #

Lift an effect into the Eff monad

method Eff<RT, A> liftEff <RT, A> (IO<A> ma) Source #

Lift an effect into the Eff monad

method Eff<RT, B> map <RT, A, B> (Eff<RT, A> ma, Func<A, B> f) Source #

Maps the IO monad if it's in a success state

Parameters

param f

Function to map the success value with

returns

Mapped IO monad

method Eff<RT, A> mapFail <RT, A> (Eff<RT, A> ma, Func<Error, Error> f) Source #

Maps the IO monad if it's in a success state

Parameters

param f

Function to map the success value with

returns

Mapped IO monad

method Eff<RT, B> bimap <RT, A, B> (Eff<RT, A> ma, Func<A, B> Succ, Func<Error, Error> Fail) Source #

Mapping of either the Success state or the Failure state depending on what state this IO monad is in.

Parameters

param Succ

Mapping to use if the IO monad is in a success state

param Fail

Mapping to use if the IO monad is in a failure state

returns

Mapped IO monad

method Eff<RT, B> match <RT, A, B> (Eff<RT, A> ma, Func<A, B> Succ, Func<Error, B> Fail) Source #

Pattern match the success or failure values and collapse them down to a success value

Parameters

param Succ

Success value mapping

param Fail

Failure value mapping

returns

IO in a success state

method Eff<RT, A> ifFail <RT, A> (Eff<RT, A> ma, Func<Error, A> Fail) Source #

Map the failure to a success value

Parameters

param f

Function to map the fail value

returns

IO in a success state

method Eff<RT, A> ifFailEff <RT, A> (Eff<RT, A> ma, Func<Error, Eff<RT, A>> Fail) Source #

Map the failure to a new IO effect

Parameters

param f

Function to map the fail value

returns

IO that encapsulates that IfFail

method Eff<RT, A> filter <RT, A> (Eff<RT, A> ma, Func<A, bool> predicate) Source #

Only allow values through the effect if the predicate returns true for the bound value

Parameters

param predicate

Predicate to apply to the bound value>

returns

Filtered IO

method Eff<RT, A> EffMaybe <RT, A> (Func<RT, Fin<A>> f) Source #

Construct an effect that will either succeed, have an exceptional, or unexceptional failure

Parameters

type A

Bound value type

param f

Function to capture the effect

returns

Synchronous IO monad that captures the effect

method Eff<RT, A> Eff <RT, A> (Func<RT, A> f) Source #

Construct an effect that will either succeed or have an exceptional failure

Parameters

type A

Bound value type

param f

Function to capture the effect

returns

Synchronous IO monad that captures the effect